package demo3;

public class Derived extends Base{
    public int c = 10;
    public int a = 100;

    public void testBase(){
        System.out.println("子类的testBase方法");
    }

    public void testDerived(int a){
        System.out.println("子类的testDerived方法");
    }

    public void method3(){
        super.testBase();
        testDerived(1);
    }

    public void method(){
        System.out.println("父类的a:" + super.a);
        System.out.println(this.a);
        System.out.println(this.b);
        System.out.println(this.c);
        /*this.a = 10;
        this.b = 20;
        this.c = 30;*/
    }

    public static void method2(){
        /*System.out.println("父类的a:" + super.a);
        System.out.println(this.a);
        System.out.println(this.b);
        System.out.println(this.c);*/
    }

    public void setBaseA(int a){
        super.a = a;
    }

    public int getBaseA(){
        return super.a;
    }

}
